<template>
  <CommonDialog :dialogShow.sync="dialogShow" :title="'更改权限'" @makeSure="makeSure">
    <template #content>
      <div class="role">
        <el-checkbox-group v-model="checkList">
          <el-checkbox label="home">首页</el-checkbox>
          <el-checkbox label="playerManage">球员管理</el-checkbox>
          <el-checkbox label="raceManage">比赛管理</el-checkbox>
          <el-checkbox label="trainManage">训练管理</el-checkbox>
          <el-checkbox label="dManage">日程管理</el-checkbox>
          <el-checkbox label="notice">通知管理</el-checkbox>
          <el-checkbox label="permissionManage">权限管理</el-checkbox>
          <el-checkbox label="roleManage">角色管理</el-checkbox>
        </el-checkbox-group>
      </div>
    </template>
  </CommonDialog>
</template>

<script>
export default {
  props: {
    changeDialog: {
      typeof: Boolean,
      default: false,
    },
    curRow: {
      typeof: Object,
      default: () => {
        return {
          id: "",
        };
      },
    },
  },
  created() {
    this.curRow.permissionList.forEach((item) => {
      this.checkList.push(item);
    });
  },
  data() {
    return {
      checkList: [],
      rules: {},
    };
  },
  computed: {
    dialogShow: {
      get() {
        return this.changeDialog;
      },
      set(v) {
        this.$emit("update:changeDialog", v);
      },
    },
  },
  mounted() {},

  methods: {
    makeSure() {
      console.log(this.checkList);
      this.$emit("makeSure",this.checkList)
    },
  },
};
</script>
<style lang="less" scoped>
.playerForm {
  ::v-deep {
    .el-form-item__label {
      color: #333;
      font-size: 16px;
      font-weight: medium;
    }
    .el-input {
      width: 380px !important;
    }
  }
}
</style>
